$(function () {
    var queryUrl = '../modulemaintainoptionshis/list';
    var optionsId = getQueryString('optionsId');
    if(optionsId){
        queryUrl += '?optionsId=' + optionsId;
    }
    $("#jqGrid").Grid({
        url: queryUrl,
        multiselect: false,
        height: 350,
        rowNum: 10,
        rowList: [10, 20, 30],
        colModel: [
            {label: '操作人', name: 'operatorName', index: 'OPERATOR', width: 80,frozen: true},
            {label: '操作', name: 'actionType', index: 'ACTION_TYPE',frozen: true, width: 80,
                formatter: function (value) {
                    return sysEnums.MOLD_MAIN_BASE_HISTORY_ACTION[value];
                }
            },
            {
                label: '操作时间', name: 'operateDate', index: 'OPERATE_DATE', width: 140,frozen: true, formatter: function (value) {
                    return transDate(value, 'yyyy-MM-dd hh:mm:ss');
                }
            },
            {label: '实施序号', name: 'orNum', index: 'OR_NUM', width: 80},
            {label: '模具类型', name: 'typeName', index: 'TYPE_S', width: 80},
            {label: '一级名称', name: 'optionSubclass', index: 'OPTION_SUBCLASS', width: 80},
            {label: '二级名称', name: 'optionName', index: 'OPTION_NAME', width: 80},
            {label: '方法手段', name: 'method', index: 'METHOD'},
            {label: '检查标准', name: 'inspectStandard', index: 'INSPECT_STANDARD'},
            {
                label: '是否有效', name: 'isEffect', index: 'IS_EFFECT', width: 80,
                formatter: function (value) {
                    return sysEnums.YES_OR_NO[value];
                }
            },
            {label: '选项备注', name: 'optionRemark', index: 'OPTION_REMARK'}
        ],
        autoScroll: false,//当autoScroll和shrinkToFit均为false时，会出现行滚动条
        shrinkToFit: true,//是否列宽度自适应。true=适应 false=不适应
    });
    $("#jqGrid").jqGrid('setFrozenColumns');//设置冻结列生效
});

let vm = new Vue({
    el: '#rrapp',
    data: {

    },
    methods: {
        reload: function (event) {
            let page = $("#jqGrid").jqGrid('getGridParam', 'page');
            $("#jqGrid").jqGrid('setGridParam', {
                postData: {'name': vm.q.name},
                page: page
            }).trigger("reloadGrid");
            vm.handleReset('formValidate');
        },
        handleReset: function (name) {
            handleResetForm(this, name);
        }
    }
});
